#base image
FROM centos:7

WORKDIR /usr/local/java
ADD jdk-8u231-linux-x64.tar.gz /usr/local/java
ENV JAVA_HOME=/usr/local/java/jdk1.8.0_231
ENV PATH=$PATH:$JAVA_HOME/bin
ENV CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
ENV JRE_HOME=$JAVA_HOME/jre

WORKDIR /data1/java
ADD gateway-bootstrap.tar.gz /data1/java

RUN mkdir -p /logs
ENV JAVA_OPTS="\
-Duser.timezone=GMT+08 \
-server \
-Xmx512m \
-Xms512m \
-Xmn256m \
-XX:MetaspaceSize=256m \
-Xss256k \
-XX:+DisableExplicitGC \
-XX:+UseConcMarkSweepGC \
-XX:LargePageSizeInBytes=512m \
-XX:+UseFastAccessorMethods \
-Dlogging.path=/logs/gateway-bootstrap \
-Dendpoints.logfile.external-file=/logs/gateway-bootstrap/gateway-bootstrap.log \
-Dfile.encoding=utf-8 \
-Dspring.config.location=/data1/java/gateway-bootstrap/conf/application.properties \
-Dspring.profiles.active=docker"

ENTRYPOINT java ${JAVA_OPTS} -jar /data1/java/gateway-bootstrap/lib/gateway-bootstrap.jar